import pkg_resources
pkg_resources.require("TurboGears")

import cherrypy
from cherrypy import config
import turbogears

turbogears.update_config(modulename="miestas.config.app")
turbogears.update_config(configfile="/home/miestas/prod.cfg")

from miestas.controllers import Root

cherrypy.root = Root()
cherrypy.config.update({"server.environment": "production",
                                "server.protocolVersion": "HTTP/1.1"})
cherrypy.server.start(initOnly=True, serverClass=None)

def fixuphandler(req):
    return 0
